package CRUD;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;


import persistence.model.Personne;

public class TestR {

	/**
	 * 
	 */
	public static void main(String[] args) {
		Configuration config = new Configuration();
		SessionFactory sf = config.configure().buildSessionFactory();
		Session session = sf.openSession();
		session.beginTransaction();
		java.util.List result = session.createQuery("from Personne").list();
		for (Personne personne: (java.util.List<Personne>) result){
		    System.out.println( "Personne (" + personne.getNomPersonne() + ")" );
		}
		session.getTransaction().commit();
		session.close();
	}
}
